var gulp = require('gulp'),
    concat = require('gulp-concat');
    sass = require('gulp-sass');

gulp.task('allJs', function () {
    return gulp.src(['www/js/*.js', 'www/directive/*/*.js', 'www/views/*/*.js'])
        .pipe(concat("all.js"))
        .pipe(gulp.dest("www/"));
});
gulp.task('sass',function () {
    return gulp.src(['scss/*.scss','scss/*/*.scss'])
        .pipe(sass().on('error', sass.logError))
        .pipe(concat("css.css"))
        .pipe(gulp.dest("www/css"));
})
gulp.task('reload', ['allJs','sass'], function () {
    
})

gulp.task('watch', function () {
    gulp.watch(['scss/*.scss','scss/*/*.scss', 'www/*.html', 'www/js/*.js', 'www/directive/*/*.js', 'www/directive/*/*.html', 'www/views/*/*.html', "www/views/*/*.js"], ['reload']);
});

gulp.task('default', ['watch']);